import ascendebug
import numpy as np
input_x = np.random.uniform(1, 100, [8, 2048]).astype(np.float16)
input_y = np.random.uniform(1, 100, [8, 2048]).astype(np.float16)
golden = (input_x + input_y).astype(np.float16)

debug_op = ascendebug.create_debug_op('AddCustom', 'VectorCore', 'Ascend910B1') \
        .tensor_input('x', input_x) \
        .tensor_input('y', input_y) \
        .tensor_output('z', golden) 

op_executor = ascendebug.create_op_executor(debug_op=debug_op, work_dir='./debug_workspace', install_path='/usr/local/Ascend')

customize_path ="/usr/local/Ascend/ascend-toolkit/latest/opp/vendors/customize"
tiling_info = op_executor.run_custom_tiling(customize_path)